<?php
session_start();
$id=$_GET['id'];
include_once($_SERVER['DOCUMENT_ROOT'].'/public/func.php');
$config=include_once($_SERVER['DOCUMENT_ROOT'].'/public/config.php');

pub($config);
$sql='select uid from message where id=$id' ;
$res_message=mysql_query($sql);

if(!isset($_SESSION['id'])){
	echo '<script> alert("登陆后才能执行该操作！"); window.history.back(-1) </script>';
}else{

	if($res_message[0]['uid']!==$_SESSION['id']) {


	echo '<script> alert("该用户才能执行该操作！"); window.history.back(-1) </script>';


}else{
	
	$res=del($config,'message','where id='.$id);
	if ($res) {
		echo '<script>alert("nice");
     window.history.back(-1)
	</script>';
	}else{
		echo "<script>alert('low');
     window.history.go(-1)  
	</script>";
	}
	
}
}



mysql_close();
 ?>